<html>
	<head>
		<title>Newton Game Dynamics DBPro Wrapper v1.53</title></head>
	<body alink="#fa634e" bgcolor="#efeff9" link="#3646fc" text="#000000" vlink="#ff6633">
		<H1>Newton SDK DBPro Wrapper v1.53</H1>
		<P>By Walaber<BR>
		   All Coding between 1.31-1.32B by Kjelle<BR>
		   Updated to 1.53 by Tiresius</P>
        <p><a href="ndb_docs_main.htm">Main Index of Commands</a></p>
		<H2>RagDoll Commands</H2>
		<p><a name="NDB_NewtonCreateRagDoll"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tbody>
				<tr>
					<td bgcolor="#232323">
						<h3><font color="#fafafa">NDB_NewtonCreateRagDoll</font></h3>
					</td>
				</tr>
				<tr>
					<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: int =
							NDB_NewtonCreateRagDoll()</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><font face="monospace">
							<table border="0" width="80%">
								<tbody>
									<tr>
										<td width="5%"></td>
										<td width="50%">no values passed to this function</td>
										<td></td>
									</tr>
								</tbody></table>
						</font>
					</td>
				</tr>
				<tr>
					<td bgcolor="#dadada"><font face="monospace">returns: integer index to the ragdoll.</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><b>Comments:</b> This command creates an empty ragdoll
						container, and returns an integer index to the ragdoll.
					</td>
				</tr>
			</tbody></table>
		<p><a name="NDB_NewtonDestroyRagDoll"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tbody>
				<tr>
					<td bgcolor="#232323">
						<h3><font color="#fafafa">NDB_NewtonDestroyRagDoll</font></h3>
					</td>
				</tr>
				<tr>
					<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
							NDB_NewtonDestroyRagDoll ragdoll</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><font face="monospace">
							<table border="0" width="95%">
								<tbody>
									<tr>
										<td width="5%"></td>
										<td width="15%">ragdoll</td>
										<td>ID of the ragdoll&nbsp;(integer)</td>
									</tr>
								</tbody></table>
						</font>
					</td>
				</tr>
				<tr>
					<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><b>Comments:</b> This command destroys the ragdoll from the
						Newton world. &nbsp;Note there is no "DestroyCallback" for ragdolls yet, so you
						must manually delete the visual objects used to represent the ragdoll onscreen
						yourself.
					</td>
				</tr>
			</tbody></table>
		<p><a name="NDB_NewtonRagDollBegin"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tbody>
				<tr>
					<td bgcolor="#232323">
						<h3><font color="#fafafa">NDB_NewtonRagDollBegin</font></h3>
					</td>
				</tr>
				<tr>
					<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
							NDB_NewtonRagDollBegin ragdoll</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><font face="monospace">
							<table border="0" width="95%">
								<tbody>
									<tr>
										<td width="5%"></td>
										<td width="15%">ragdoll</td>
										<td>ID of the ragdoll&nbsp;(integer)</td>
									</tr>
								</tbody></table>
						</font>
					</td>
				</tr>
				<tr>
					<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><b>Comments:</b> This command tells Newton you want to begin
						adding / defining the bones that will make up the ragdoll. &nbsp;You must call
						this command before you can add bones to a ragdoll.
					</td>
				</tr>
			</tbody></table>
		<p><a name="NDB_NewtonRagDollEnd"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tbody>
				<tr>
					<td bgcolor="#232323">
						<h3><font color="#fafafa">NDB_NewtonRagDollEnd</font></h3>
					</td>
				</tr>
				<tr>
					<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
							NDB_NewtonRagDollEnd ragdoll</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><font face="monospace">
							<table border="0" width="95%">
								<tbody>
									<tr>
										<td width="5%"></td>
										<td width="15%">ragdoll</td>
										<td>ID of the ragdoll&nbsp;(integer)</td>
									</tr>
								</tbody></table>
						</font>
					</td>
				</tr>
				<tr>
					<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><b>Comments:</b> This command tells Newton you are finished
						adding / defining the bones that make up a ragdoll. &nbsp;This should be called
						after all settings for the ragdoll are complete.
					</td>
				</tr>
			</tbody></table>
		<p><a name="NDB_NewtonRagDollAddBone"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tbody>
				<tr>
					<td bgcolor="#232323">
						<h3><font color="#fafafa">NDB_NewtonRagDollAddBone</font></h3>
					</td>
				</tr>
				<tr>
					<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: int =
							NDB_NewtonRagDolladdBone( ragdoll, p_bone, col,&nbsp;mass )</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><font face="monospace">
							<table border="0" width="95%">
								<tbody>
									<tr>
										<td width="5%"></td>
										<td width="15%">ragdoll</td>
										<td>ID of the ragdoll&nbsp;(integer)</td>
									</tr>
									<tr>
										<td width="5%">&nbsp;</td>
										<td width="15%">p_bone</td>
										<td>
											<P>ID of the parent bone (integer)</P>
										</td>
									</tr>
									<TR>
										<TD width="5%"></TD>
										<TD width="15%">col</TD>
										<TD>ID of the bone collision geometry. (integer)</TD>
									</TR>
									<tr>
										<td width="5%">&nbsp;</td>
										<td width="15%">mass</td>
										<td>mass of the bone (float)</td>
									</tr>
									<tr>
										<td width="5%">&nbsp;</td>
										<td width="15%">(matrix)</td>
										<td>temp matrix used for passing values</td>
									</tr>
									<tr>
										<td width="5%">&nbsp;</td>
										<td width="15%">(vector 1)</td>
										<td>temp vector used for passing values</td>
									</tr>
								</tbody></table>
						</font>
					</td>
				</tr>
				<tr>
					<td bgcolor="#dadada"><font face="monospace">returns: integer index of the newly
							created bone.</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa">
						<p><b>Comments:</b> This command adds a bone to the specified ragdoll. &nbsp;Note
							that the internal <b>temp matrix</b> is used for the position and rotation of
							the bone (in local space based on the parent bone), and <b>temp vector 1</b> is
							used to describe the size of the bone. &nbsp;See the ragdoll tutorial for
							examples of this command in use.</p>
						<p>This command must be called in-between a <a href="#NDB_NewtonRagDollBegin">NDB_NewtonRagDollBegin</a>
							/ <a href="#NDB_NewtonRagDollEnd">NDB_NewtonRagDollEnd</a> pair.
						</p>
					</td>
				</tr>
			</tbody></table>
		<p><a name="NDB_NewtonRagDollBoneSetLimits"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tbody>
				<tr>
					<td bgcolor="#232323">
						<h3><font color="#fafafa">NDB_NewtonRagDollBoneSetLimits</font></h3>
					</td>
				</tr>
				<tr>
					<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
							NDB_NewtonRagDollBoneSetLimits ragbone, min_cone, max_cone, max_twist</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><font face="monospace">
							<table border="0" width="95%">
								<tbody>
									<tr>
										<td width="5%"></td>
										<td width="15%">ragbone</td>
										<td>ID of the ragdoll&nbsp;bone&nbsp;(integer)</td>
									</tr>
									<tr>
										<td width="5%">&nbsp;</td>
										<td width="15%">min_cone</td>
										<td>minimum cone rotation (float)</td>
									</tr>
									<tr>
										<td width="5%">&nbsp;</td>
										<td width="15%">max_cone</td>
										<td>maximum cone rotation (float)</td>
									</tr>
									<tr>
										<td width="5%">&nbsp;</td>
										<td width="15%">max_twist</td>
										<td>maximum twist rotation (float)</td>
									</tr>
									<tr>
										<td width="5%">&nbsp;</td>
										<td width="15%">(vector 1)</td>
										<td>temp vector used for passing values</td>
									</tr>
								</tbody></table>
						</font>
					</td>
				</tr>
				<tr>
					<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa">
						<p><b>Comments:</b> This command sets the rotational limits for a particular bone.
							&nbsp;Before calling this command you must set temp vector 1 to a unit-vector
							describing the <i>direction</i> of the pin in <b>global space</b>.</p>
						<p>This command must be called in-between a <a href="http://walaber.com/ndb/ndb_docs.html#NDB_NewtonRagDollBegin">
								NDB_NewtonRagDollBegin</a> / <a href="http://walaber.com/ndb/ndb_docs.html#NDB_NewtonRagDollEnd">
								NDB_NewtonRagDollEnd</a> pair.</p>
					</td>
				</tr>
			</tbody></table>
		<p>&nbsp;</p>
		<p>
			<a name="NDB_RagDollSetGravity"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_RagDollSetGravity</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_RagDollSetGravity ragdoll,flag</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">ragdoll</td>
											<td>ID of the ragdoll&nbsp;bone&nbsp;(integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">
												flag</td>
											<td>
										<TR>
											<TD width="5%"></TD>
											<TD width="15%">flag</TD>
											<TD>gravity flag (1=gravity on, 0=gravity off)</TD>
										</TR>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> sets the custom gravitational force for the
							specified ragdoll to the contents of <b>temp vector 1</b>.</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_RagDollGetGravity"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_RagDollGetGravity</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_RagDollGetGravity ragdoll</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">ragdoll</td>
											<td>ID of the ragdoll&nbsp;bone&nbsp;(integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">(vector 1)</td>
											<td>temp vector used to return values.</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> fills <b>temp vector 1</b> with the custom
							gravity set for the specified ragdoll.</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_RagDollBoneSetDBProData"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_RagDollBoneSetDBProData</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_RagDollBoneSetDBProData bone, db_num, limb_num</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">bone</td>
											<td>ID of the ragdoll&nbsp;bone&nbsp;(integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">db_num</td>
											<td>ID of the dbpro&nbsp;object&nbsp;(integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">limb_num</td>
											<td>ID of the dbpro&nbsp;object&nbsp;limb&nbsp;(integer)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> This command assigns a dbpro object (or limb
							thereof) to a ragdoll bone. If the limb is set to "0" (zero), the object's
							position will also be updated based on the position of the bone. Use this for
							the root bone, or ragdolls made up of seperate objects. A limb number greater
							than zero will rotate the limb of the object to the local rotation matrix of
							the bone. Don't forget to set an offset (<a href="#NDB_RagDollBoneSetOffset">NDB_RagDollBoneSetOffset</a>)
							for the bone, or your ragdoll might not rotate correctly!</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_RagDollBoneSetOffset"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_RagDollBoneSetOffset</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_RagDollBoneSetOffset bone</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">bone</td>
											<td>ID of the ragdoll&nbsp;bone&nbsp;(integer)</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">(matrix)</td>
											<td>temp matrix used to pass values.</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> sets the "zero position" for the ragdoll
							bone rotation. DBPro considers a model's default pose (frame 0 in the object's
							animation) to be the "zero" point for limb rotation. The newton wrapper needs
							to know the rotation that defines the "zero" point, so that it can rotate the
							limbs properly. Usually, you can use the same matrix used when creating the
							bones. However if you are trying to create a ragdoll in a different pose than
							the default pose, the matrix used to create the bones will be different from
							this matrix. Generally this matrix should stay the same for a single model,
							regardless of what pose you create the ragdoll in. For more information please
							check the ragdoll tutorial, and the ragdoll examples.</td>
					</tr>
					<tr>
						<td bgcolor="#fafafa">
							<b>EXAMPLE:</b> biuld a matrix, and set the bone offset
							<br>
							<font face="monospace"><b>NDB_BuildMatrix 78.0, -50.0, 35.0, 2.0, 0.0, 0.0<br>
									NDB_RagDollBoneSetOffset LArmbone</b></font>
						</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_RagDollBoneGetBody"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_RagDollBoneGetBody</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: int =
								NDB_RagDollBoneGetBody( bone )</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">bone</td>
											<td>ID of the ragdoll&nbsp;bone&nbsp;(integer)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: integer index to the rigid body
								for the bone</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> This command returns the index of the rigid
							body for the supplied bone. All ragdoll bones are actually rigid bodies, and
							using this command you can do things you might do to other rigid bodies, such
							as attach external joints to them, add impulses to them, assign materials, etc.</td>
					</tr>
					<tr>
						<td bgcolor="#fafafa">
						</td>
					</tr>
				</tbody></table>
		<p><a name="NDB_RagDollExist"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tbody>
				<tr>
					<td bgcolor="#232323">
						<h3><font color="#fafafa">NDB_RagDollExist</font></h3>
					</td>
				</tr>
				<tr>
					<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: int =
							NDB_RagDollExist( ragdoll&nbsp;)</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><font face="monospace">
							<table border="0" width="95%">
								<tbody>
									<tr>
										<td width="5%"></td>
										<td width="15%">ragdoll</td>
										<td>ID of the ragdoll&nbsp;(integer)</td>
									</tr>
								</tbody></table>
						</font>
					</td>
				</tr>
				<tr>
					<td bgcolor="#dadada"><font face="monospace">returns: 1 if ragdoll exists, 0 if it
							doesn't</font></td>
				</tr>
			</tbody></table>
		<p><a name="NDB_RagDollBoneExist"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tbody>
				<tr>
					<td bgcolor="#232323">
						<h3><font color="#fafafa">NDB_RagDollBoneExist</font></h3>
					</td>
				</tr>
				<tr>
					<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: int =
							NDB_RagDollBoneExist( bone&nbsp;)</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><font face="monospace">
							<table border="0" width="95%">
								<tbody>
									<tr>
										<td width="5%"></td>
										<td width="15%">bone</td>
										<td>ID of the ragdoll&nbsp;bone (integer)</td>
									</tr>
								</tbody></table>
						</font>
					</td>
				</tr>
				<tr>
					<td bgcolor="#dadada"><font face="monospace">returns: 1 if ragdoll bone exists, 0 if it
							doesn't</font></td>
				</tr>
			</tbody></table>
		<p>&nbsp;</p>
		<p>
		</p>
	</body>
</html>
